package com.mykt.service;

import com.mykt.service.impl.WeiXinPayImpl;
import com.mykt.service.impl.ZhiFuBaoPayImpl;


public class PayServiceFactory {

    private String payType;

    public PayServiceFactory(String payType){
        this.payType=payType;
    }


    public PayService pay(){

        PayService payService=null;

        switch (payType){
            case "":
                System.out.println("微信支付");
                payService = new WeiXinPayImpl();
                break;
            case "支付宝":
                System.out.println("支付宝支付");
                payService = new ZhiFuBaoPayImpl();
                break;
            default:
                System.out.println("暂无该支付方式");
        }

        return payService;

    }


}
